#!/bin/bash

#自动化部署httpd服务和实时同步架构

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
export PATH

for host in `cat /root/remote-hosts`
do
   sshpass -p'1' ssh-copy-id -o StrictHostKeyChecking=no root@${host}
done

ansible-playbook -i /root/lnmp-all/roles/hosts /root/lnmp-all/roles/site.yml




[root@manager ~]# vim remote-hosts 

#loadblance
172.16.1.6
172.16.1.5

#web
172.16.1.7
172.16.1.8

#nfs
172.16.1.31

#rsync
172.16.1.41

#database
172.16.1.51

